package p.ithorns.sample.refresh;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * ConfigContext
 *
 * @author HtL
 * @date 2025/3/14 14:56
 * @since 1.0.0
 */
public class ConfigContext {

    private final static Map<String, Object> configs = new ConcurrentHashMap<>();

    private final static Map<String, ValueHolder> valueHolders = new ConcurrentHashMap<>();

    public static void refreshConfig(Map<String, Object> properties) {
        configs.putAll(properties);
    }

    public static Map<String, Object> getConfigs() {
        return configs;
    }

    public static ValueHolder getValueHolder(String key) {
        return valueHolders.get(key);
    }

    public static Map<String, ValueHolder> getValueHolders() {
        return valueHolders;
    }

}